package com.orangeforms.webadmin.app.model;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;
import java.util.Map;

import com.orangeforms.common.core.annotation.RelationConstDict;
import com.orangeforms.common.core.annotation.RelationDict;
import com.orangeforms.common.core.annotation.UploadFlagColumn;
import com.orangeforms.common.core.base.mapper.BaseModelMapper;
import com.orangeforms.common.core.upload.UploadStoreTypeEnum;
import com.orangeforms.webadmin.app.model.constant.CheckChangeStaus;
import com.orangeforms.webadmin.app.model.constant.SpCheckOrgType;
import com.orangeforms.webadmin.app.vo.SpecialCheckVo;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableField;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 项目建设——专项检查(SpecialCheck)表实体类
 *
 * @author makejava
 * @since 2022-08-03 15:44:25
 */
@SuppressWarnings("serial")
@Data
@TableName("special_check")
public class SpecialCheck {
     /**
     * 主键
     */
    @TableId(value = "special_check_id",type = IdType.AUTO)
    private Long specialCheckId;
     /**
     * 项目id
     */
    @TableField(value = "pro_id")
    private Long proId;
     /**
     * 施工合同
     */
    @TableField(value = "section_id")
    private Long sectionId;
     /**
     * 检查描述
     */
    @TableField(value = "check_describe")
    private String checkDescribe;
     /**
     * 检查报告
     */
    @UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
    @TableField(value = "check_report")
    private String checkReport;
     /**
      * 字典-1
     * 整改状态：-1：待发布 0：待整改，1：整改中 2：整改完成，4：无需整改
     */
    @TableField(value = "change_staus")
    private Integer changeStaus;
     /**
     * 添加时间
     */
    @TableField(value = "add_time")
    private Date addTime;
     /**
     * 整改日期
     */
    @TableField(value = "check_date")
    private Date checkDate;
     /**
      * 字典-2
     * 检测单位: 0:教育集团  1：校区 2：教研室  9：其他单位
     */
    @TableField(value = "check_org_type")
    private Integer checkOrgType;
     /**
     * 创建机构
     */
    @TableField(value = "create_org_id")
    private Long createOrgId;
     /**
     * 添加人
     */
    @TableField(value = "create_by")
    private Long createBy;
     /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    @RelationDict(
            masterIdField = "proId",
            slaveServiceName = "sysProjectService",
            slaveModelClass = SysProject.class,
            slaveIdField = "id",
            slaveNameField = "shorthand")
    @TableField(exist = false)
    private Map<String, Object> projectIdDictMap;

    @RelationConstDict(
            masterIdField = "changeStaus",
            constantDictClass = CheckChangeStaus.class)
    @TableField(exist = false)
    private Map<String,Object> changeStausDictMap;

    @RelationConstDict(
            masterIdField = "checkOrgType",
            constantDictClass = SpCheckOrgType.class)
    @TableField(exist = false)
    private Map<String,Object> checkOrgTypeDictMap;

    @RelationDict(
            masterIdField = "sectionId",
            slaveServiceName = "sysContractInfoService",
            slaveModelClass = SysContractInfo.class,
            slaveIdField = "id",
            slaveNameField = "name")
    @TableField(exist = false)
    private Map<String, Object> contractIdDictMap;


    @Mapper
    public interface SpecialCheckModelMapper extends BaseModelMapper<SpecialCheckVo,SpecialCheck> {
        /**
         * 转换Vo对象到实体对象。
         *
         * @param SpecialCheckVo 域对象。
         * @return 实体对象。
         */
        @Override
        SpecialCheck toModel(SpecialCheckVo domain);
        /**
         * 转换实体对象到VO对象。
         *
         * @param SpecialCheck 实体对象。
         * @return 域对象。
         */
        @Override
        SpecialCheckVo fromModel(SpecialCheck model);
    }
    public static final SpecialCheckModelMapper INSTANCE = Mappers.getMapper(SpecialCheckModelMapper.class);

}

